package com.test;

import io.netty.util.internal.SystemPropertyUtil;

import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author wufagang
 * @description
 * @date 2022年06月21日 14:56
 */
public class QueueDemo {

    public static void main(String[] args) {
        Queue<Runnable> queue =  new LinkedBlockingQueue<Runnable>(16);
        queue.add(()->{
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("1");
        });
        queue.add(()->{
            System.out.println("2");
        });
        queue.add(()->{
            System.out.println("3");
        });
        queue.poll().run();
        queue.poll().run();
        queue.poll().run();
        new Thread().run();

        System.out.println(Integer.MAX_VALUE);
        System.out.println(SystemPropertyUtil.getInt("io.netty.eventexecutor.maxPendingTasks", Integer.MAX_VALUE));
    }
}
